<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:73:"D:\wamp\www\zz\tp5\public/../application/personal\view\Message\index.html";i:1499045106;s:71:"D:\wamp\www\zz\tp5\public/../application/personal\view\Index\index.html";i:1499045106;}*/ ?>
﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta name="keywords" content="众评网，新闻资讯应用，头条，热点，科技，娱乐，健康，时尚，家居，教育，旅行，两性，美食，星座，阅读，个性化新闻">
    <meta name="description"
          content="众评网是一款高度智能的新闻资讯，通过它你可以搜索并订阅任意关键词，它会自动帮你聚合整理并更新相关资讯，同时会智能分析你的兴趣爱好，为你推荐感兴趣的内容。看新闻资讯，众评网就够了！">
    <title><?php echo $title; ?></title>
    <link rel="stylesheet" type="text/css" href="/static/home/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/static/home/css/my.css" />
    <link rel="stylesheet" type="text/css" href="/static/personal/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="/static/personal/jietu/dist/amazeui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/personal/css/personal.css" />
    <link rel="stylesheet" type="text/css" href="/static/personal/css/reset.css" />
</head>
<body>
<div class="header-channel-nav header-mini ">
    <div class="content">
        <!--<a href="/" class="logo float-left iconfont icon-logo"></a>-->
        <div class="float-right header-links anim">
            <?php if(!session('?tel')): ?>
            <button type="button" class="tn btn-login js-to-login " data-toggle="modal" data-target="#exampleModal" id="dengru">登录
            </button>
            <?php else: ?>
            <div class="dropdown">
            <a id="dLabel" data-target="#" href="http://example.com" data-toggle="dropdown" role="button"
            aria-haspopup="true" aria-expanded="false">
            <?php if(session('?name')): ?>
            <?php echo session('name'); else: ?>
            <?php echo session('tel'); endif; ?>
            </a>
            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1" style="min-width: 1px">
            <li><a href="/personal">个人中心</a></li>
            <li><a href="/media">添加频道</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="<?php echo url('index/Index/Log'); ?>">退出</a></li>
            </ul>
            </div>
            <?php endif; ?>
        </div>

        <div class="channel-nav">
            <nav class="navbar navbar-default" style="border: 0px;">
                <div class="navbar-header">
                    <a data-index="0" href="/index" data-channelid="best"
                       class="navbar-brand active">首页</a>
                    <a data-index="1"
                       href="/focus"
                       data-channelid="hot" class="navbar-brand ">要闻</a>
                    <?php if(($ass !== null)): if(is_array($ass) || $ass instanceof \think\Collection || $ass instanceof \think\Paginator): $i = 0; $__LIST__ = $ass;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fl): $mod = ($i % 2 );++$i;?>
                    <a data-index="1"
                       href="/focus/<?php echo $fl['cid']; ?>"
                       data-channelid="hot" class="navbar-brand" xh="vo"><?php echo $fl['cname']; ?></a>
                    <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                </div>
            </nav>
        </div>
    </div>
</div>

<!--main 开始-->

<div class="main">

    <div class="left-wrapper">
        <div class="profile-wrapper">
            <?php if(($user['icon'] == null)): ?>
            <img src="/static/personal/img/batman.jpg" width="90">
            <?php else: ?>
            <img src="<?php echo $user['icon']; ?>" >
            <?php endif; ?>
            <p>
               <?php echo $user['nickname']; ?>
            </p>
        </div>
        <ul class="nav-list">
            <li class="subscribe-li"><a href="/personal" class="font20">我的收藏</a></li>
            <li class="subscribe-li"><a href="/follow" class="font20">我的关注</a></li>
            <li class="subscribe-li"><a href="/discuss" class="font20">我的评论</a></li>
            <li class="subscribe-li"><a href="/message" class="font20">我的信息</a></li>
            <li class="subscribe-li"><a href="/article" class="font20">我的文章</a></li>
        </ul>
    </div>




    <!--个个栏目体  开始-->
    <div class="right-wrapper">
        <div class="layui-tab layui-tab-brief" >
            <ul class="layui-tab-title">
                <li class="layui-this font20">我的信息</li>
                <li class="font20">修改密码</li>
            </ul>
            <div class="layui-tab-content">
                <!--个人信息-->
                <div class="layui-tab-item layui-show" lay-filter="docDemoTabBrief">

                        <form class="layui-form"  action="message/update" method="post" enctype="multipart/form-data"
                              name="myform">

                            <!--头像-->
                            <div class="mtl100">
                                <div class="am-popup" id="my-popup">
                                    <div class="am-popup-inner">
                                        <div class="am-popup-hd">
                                            <h4 class="am-popup-title">裁剪图片</h4>
                                            <span data-am-modal-close class="am-close">&times;</span>
                                        </div>
                                        <div class="am-popup-bd">
                                            <!-- 裁剪显示区 -->
                                            <div class="am-margin-bottom-sm" id="clip" style="width: 100%;height: 400px;"></div>

                                            <button type="button" class="am-btn am-btn-primary" id="clipBtn">
                                                裁剪
                                            </button>

                                            <input class="am-hide" type="file" id="file">
                                        </div>
                                    </div>
                                </div>

                                <div>
                                    <img class="am-img-circle am-img-thumbnail" src="<?php echo $message['icon']; ?>" id="img-view"  width="100"/>
                                    <br>
                                    <button type="button" class="am-btn am-btn-primary" id="toggle-file" style="font-size: 16px;">修改头像</button>
                                </div>
                            </div><!--图像结束-->

                            <!--姓名-->
                            <div class="layui-form-item mt20">
                                <label class="layui-form-label">昵称:</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="nickname" required  lay-verify="nicname" placeholder="请输入昵称" autocomplete="off" class="layui-input" value="<?php echo $message['nickname']; ?>">
                                    <input type="hidden" name="icon" value="" id="myicon">
                                </div>
                                <div class="layui-form-mid layui-word-aux">请填写3到10位</div>
                            </div>
                            <!--手机号-->
                            <div class="layui-form-item">
                                <label class="layui-form-label">手机号</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="tel" required lay-verify="phone" autocomplete="off" class="layui-input" disabled value="<?php echo $message['tel']; ?>">
                                </div>
                            </div>
                            <!--邮箱-->
                            <div class="layui-form-item">
                                <label class="layui-form-label">邮箱</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="email" value="<?php echo $message['email']; ?>" required lay-verify="email"  placeholder="请输入您的邮箱" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <!--性别-->
                            <div class="layui-form-item">
                                <label class="layui-form-label">单选框</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="sex" value="1" title="男" <?php if($message['sex'] == '1'): ?>checked<?php endif; ?> >
                                    <input type="radio" name="sex" value="0" title="女" <?php if($message['sex'] == '0'): ?>checked<?php endif; ?>>
                                </div>
                            </div>
                            <!--保存修改-->
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">保存修改</button>
                                </div>
                            </div>
                        </form>
                </div>
                <!--修改密码 没有写-->
                <div class="layui-tab-item">
                    <form class="layui-form" action="personal/Message/save" method="post" enctype="multipart/form-data"
                          name="myform">
                        <!--确认密码-->
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 120px;"> 当前密码 : </label>
                            <div class="layui-input-inline">
                                <input type="password" name="pwd" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input" >
                            </div>
                            <div class="layui-form-mid layui-word-aux">辅助文字</div>

                        </div>
                        <!--新密码-->
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 120px;"> 新密码 : </label>
                            <div class="layui-input-inline">
                                <input type="password" name="newpwd" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">辅助文字</div>

                        </div>
                        <!--确认新密码-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label" style="width: 120px;">确认新密码 : </label>
                            <div class="layui-input-inline">
                                <input type="password" name="repswd" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">辅助文字</div>
                        </div>
                        <!--手机号-->
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 120px;"> 手机号 : </label>
                            <div class="layui-input-inline">
                                <input type="text" name="tel" required lay-verify="phone" autocomplete="off" class="layui-input phone" disabled value="<?php echo $message['tel']; ?>">
                            </div>
                        </div>
                        <!--效验码-->
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label" style="width: 120px;">效验码 : </label>
                            <div class="layui-input-inline" >
                                <input type="text " name="numb"  lay-verify="required" placeholder="请输入六位效验码" autocomplete="off" class="layui-input yzmnum">
                            </div>
                            <div class="layui-form-mid layui-word-aux"><i name="button" class="layui-btn layui-btn-smal yzm">获取短信效验码</i></div>
                        </div>
                        <!--确认修改-->
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type='submit' name="button" class="layui-btn" value="确认修改"/>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div> <!--个个栏目体  结束-->
</div>  <!--main 结束-->
<script type="text/javascript" src="/static/home/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/home/js/bootstrap.js"></script>
<script type="text/javascript" src="/static/personal/layui/layui.js"></script>
<script type="text/javascript" src="/static/personal/jietu/dist/jquery.min.js"></script>
<script type="text/javascript" src="/static/personal/jietu/dist/amazeui.min.js"></script>
<script type="text/javascript" src="/static/personal/jietu/dist/iscroll-zoom.min.js"></script>
<script type="text/javascript" src="/static/personal/jietu/dist/hammer.min.js"></script>
<script type="text/javascript" src="/static/personal/jietu/dist/photoClip.min.js"></script>

<script>
    layui.use(['form','element','layer'], function(){
        // tab 选项卡
        var element = layui.element();
        //form 表单
        var form = layui.form();
        var layer = layui.layer;
        form.verify({
            nicname: function(value) {
                if (value.length < 3 || value.length > 10) {
                    return '昵称至少3个字符,最多10个字符';
                }
            },

        });
        $('.yzm').bind('click',function(){
            var id = $('.phone').val();
            showtime(60);
//            console.log(phone);
            $.ajax({
                type:'post',
                url:'message/' + id,
                dateType:'json',
                success:function (data) {
                    if (!data > 0){
                        alert('获取验证码失败!');
                    } else {
                        setTimeout(function(){
                            $('.yzmnum').attr('name','nump');
                        },60000);
                    }
                },
                error:function () {
                    alert('请求出错!');
                }

            });
        });

    });
    function showtime(t){
        $('.yzm').addClass('layui-btn-disabled');
        for(i=1;i<=t;i++) {
            window.setTimeout("update_p("+i+","+t+")", i * 1000);
        }

    }

    function update_p(num,t) {
        if(num == t) {
            $('.yzm').removeClass('layui-btn-disabled').text('重新发送') ;
            $('.yzm').removeClass('layui-btn-disabled');
        }
        else {
            printnr = t-num;
            $('.yzm').text('('+printnr+')秒后重新发送') ;
        }
    }
    //上传截图
    $(function() {
        var $clip = $("#clip");
        var $file = $("#file");
        var $imgView = $("#img-view");
        var $popup = $("#my-popup");
        $("#toggle-file").click(function() {
            $file.trigger("click");
            $popup.modal({
                closeViaDimmer: false
            });
        });

        $clip.photoClip({
            width: 250,
            height: 250,
            fileMinSize: 20,
            file: $file,
            ok: "#clipBtn",
            loadStart: function() {
                console.log("照片读取中");
            },
            loadProgress: function(progress) {
                console.log(progress);
            },
            loadError: function() {
                alert("图片加载失败");
            },
            loadComplete: function() {
                console.log("照片读取完成");
            },
            imgSizeMin: function(kbs) {
                alert(kbs, "上传图片过小");
            },
            clipFinish: function(dataURL) {
//                console.log(dataURL);
                document.getElementById("img-view").src = dataURL;
                document.getElementById("myicon").value = dataURL;
                $popup.modal("close");
            }

        });
    })

</script>




<div class="footer-mini-wrapper">
    <div class="footer-mini">
        <p>
            <span class="icon-jgw"></span><span>京公网安备 11010802020163号</span><a
                target="_blank">互联网药品信息服务资格证书</a><span>京网文[2015]0377-157号</span><span>京ICP证140123号</span>
        </p>
        <p>
           <span>公司名称：众评科技有限公司</span>
        </p>
    </div>
</div>

</body>
</html>